home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / lgfil1 / lgfil100.txt < prev    next >
Text File  |  1993-09-07  |  4KB  |  127 lines

  1. LOGFILE Version 1.0 Documentation
  2. -------------------------------------------------------------
  3.  
  4. Purpose:
  5. The purpose of LOGFILE is to provide developers a simple means
  6. of recording activity in an application for later review.  This
  7. DLL was originally intended for use in Visual Basic, as in VB 
  8. it is a little more tedious to write to text files and handle 
  9. all the potential DOS errors that can occurr.  However, any 
  10. Windows development language can make use of the functions in 
  11. LOGFILE.DLL.
  12.  
  13. LOGFILE takes text lines passed to it, and writes the lines to
  14. a text file, as specified.  This text file are available to
  15. read at any time.
  16. -------------------------------------------------------------
  17. System /Software Requirements:
  18.     Windows 3.1    (any configuration)
  19.     Windows Development Language 
  20.  
  21. NOTE: THIS DLL HAS NOT BEEN TESTED IN A WINDOWS 3.0 ENVIRONMENT!
  22. -------------------------------------------------------------
  23. Installation:
  24.  
  25. LGFIL100.DLL Must be copid to either:
  26.     1) Your Windows\System directory (or equivilant)
  27.     2) any directory in your path
  28.     or 3) your application directory
  29.  
  30. The remaining files can be placed any where.  You will need
  31. LGFIL100.LIB to develop C/C++ applications for this DLL.  
  32. Please remember to use the order.doc form for registering your
  33. software.
  34. ---------------------------------------------------------------
  35. USAGE:
  36. *    Setting it up in your code
  37. Each function will need to be declared in your code (VB USERS,
  38. please see below).  Declarations should appear like:
  39.  
  40. C applications:
  41. extern int INIT_LOGFILE(char *);
  42. extern int WRITE_LOGFILE_RECORD(char *);
  43. extern int CLOSE_LOGFILE();
  44.  
  45. C++ Applications:
  46. extern "C" int INIT_LOGFILE(char *);
  47. extern "C" int WRITE_LOGFILE_RECORD(char *);
  48. extern "C" int CLOSE_LOGFILE();
  49.  
  50.  
  51. *    INIT_LOGFILE
  52. This function must be called in order to establish a link to
  53. a file.  This function must be passed the file and path of the
  54. file to write records to.  It is up to the developer to ensure 
  55. that the file (and it associated path) are correct and complete. 
  56. RETURNS a value of 1 on successfull initialization, and -1 
  57. on failure.
  58.  
  59.  
  60. EG:    int xreturn;
  61.     xreturn = INIT_LOGFILE("C:\MYFILE.LOG");
  62.  
  63.  
  64.  
  65. *    WRITE_LOGFILE_RECORD
  66. This function is called for each line of text that should be 
  67. stored in the specified text file.  RETURNS the number of bytes 
  68. written to the file.
  69.  
  70.  
  71. EG:    int xreturn;
  72.     xreturn = WRITE_LOGFILE_RECORD("This is my record");
  73.  
  74.  
  75.  
  76. *    CLOSE_LOGFILE
  77. This function closes the file and returns the file handle to DOS.
  78. RETURN value is not meaningful.
  79.  
  80. EG:    int xreturn;
  81.     xreturn = CLOSE_LOGFILE();
  82. -----------------------------------------------------------------
  83. Visual Basic Users:
  84. Your declare statements should look like (one statement per line):
  85. Declare Function INIT_LOGFILE Lib "LGFIL001.DLL" 
  86.             (ByVal xstring As String) As Integer
  87. Declare Function WRITE_LOGFILE_RECORD Lib "LGFIL001.DLL"
  88.             (ByVal xstring As String) As Integer
  89. Declare Function CLOSE_LOGFILE Lib "LGFIL001.DLL" () As Integer
  90.  
  91. and usage like:
  92. Dim xret%
  93.  
  94. xret% = INIT_LOGFILE("c:\myfile")
  95. xret% = WRITE_LOGFILE_RECORD("this is my record")
  96. xret% = CLOSE_LOGFILE()
  97. -----------------------------------------------------------------
  98. Note:
  99.  
  100. LOGFILE conforms to the Windows Standards and should accessible
  101. to any Windows development language which provides for Window API 
  102. access.
  103.  
  104. LOGFILE should be usable in PowerBuilder, Turbo PASCAL, 
  105. Visual C++, plus many more...
  106. =================================================================
  107.  
  108. FUTURE VERSIONS:
  109.  
  110. In future versions, I plan on adding much more functionality
  111. than what is present in version 1.0.  Plans include,
  112.     1) Logging to Multiple Files
  113.     2) Specified Record Lengths
  114.     3) Viewer for files
  115.     3) Print Capablities for files
  116.     4) File/Path validation
  117.     5) Meaningfull return codes and Error Messages
  118.  
  119. Thank you for trying LOGFILE Version 1.0!  I hope that this
  120. simple utility proves useful. 
  121.  
  122.  
  123. FOR SUGGESTIONS, COMMENTS and SUPPORT (registered users):
  124. CompuServe Information Systems ID # 73113,2625
  125.  
  126.  
  127. All trademarks are property of their respective owners.